package com.dongdongshop.data;

import java.io.Serializable;

public class ItemCatResule<T> implements Serializable {
    private Integer code;
    private String message;
    //集合数据
    private T data;
    //单条数据
    private T info;
    //回返父级数据
    private T parentData;

    public ItemCatResule(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ItemCatResule ok(){
        return new ItemCatResule(ResuleEnum.OK.getCode(),ResuleEnum.OK.getValue());
    }
    public static ItemCatResule fail(){
        return new ItemCatResule(ResuleEnum.FAIL.getCode(),ResuleEnum.FAIL.getValue());
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public ItemCatResule setData(T data) {
        this.data = data;
        return this;
    }

    public T getInfo() {
        return info;
    }

    public ItemCatResule setInfo(T info) {
        this.info = info;
        return this;
    }

    public T getParentData() {
        return parentData;
    }

    public ItemCatResule setParentData(T parentData) {
        this.parentData = parentData;
        return this;
    }
}
